About The Regular Expression Tester
A Regular Expression (or Regex) is a sequence of characters that specifies a search pattern in text. This tool allows you to test your JavaScript-compatible regular expressions against a sample text, providing instant visual feedback by highlighting all matches and listing the captured groups.
Common Flags
-
g
(Global): Finds all matches instead of stopping after the first one. -
i
(Case-Insensitive): Makes the expression case-insensitive (e.g., /a/i would match "a" and "A"). -
m
(Multiline): Allows start (^
) and end ($
) anchors to match at the beginning and end of each line, not just the whole string. -
s
(Dot All): Allows the dot (.
) to match newline characters as well.
How to Use This Tool:
-
Enter Your Regex: Type your regular expression
pattern in the input field between the slashes
/.../
. - Select Flags: Check the boxes for any flags (like global or case-insensitive) you want to apply.
- Provide Test String: Paste or type the text you want to test your expression against in the larger text area.
-
See Instant Results: As you type, the tool will
automatically:
- Highlight all matching parts of your test string.
- List all the matches and their capture groups in the panel below.
- Debug: If your expression is invalid, an error message will appear in the results panel.